package com.twt.recruit.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.twt.recruit.entity.GroupInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface GroupMapper extends BaseMapper<GroupInfo> {

    @Select("select group_id from project_group where project_id = #{projectId}")
    List<Integer> getGroupIdByProjectId(Integer projectId);

    @Delete("delete from project_group where project_id = #{projectId}")
    void delProjectGroupByProjectId(Integer projectId);

    void delGroupByGroupId(List<Integer> groupIdList);

    @Select("select group_id from group_info where club_id = #{clubId} and group_name = #{group}")
    Integer getGroupId(Integer clubId, String group);
}
